home *** CD-ROM | disk | FTP | other *** search
- /* ************************************************************** *\
- To compile in Think C:
- 1) Set Project Type to 'Code Resource'
- 2) Set the File TYPE to 'RXXT' and File Creator to 'ResX'
- 3) Set the Resource TYPE to 'RXVW'
- 4) Set the Resource NAME to 'snd '.
- 5) Add this file, MacTraps, and ResX Utils.lib to the project
- 6) Compile the code resource.
- 7) Install it in ResX via the 'Externals->Install' menu.
- \* ************************************************************** */
-
-
- #include "ResX Utils.h"
- #include "Duplicate.h"
- #include "MacTypes.h"
- #include "QuickDraw.h"
- #include "DeviceMgr.h"
- #include "EventMgr.h"
- #include "FileMgr.h"
- #include "MemoryMgr.h"
- #include "ResourceMgr.h"
- #include "WindowMgr.h"
- #include "SetUpA4.h"
- #include "String.h"
- #include "SoundMgr.h"
-
- #define TRUE 1
- #define FALSE 0
- #define NIL 0
-
-
- /* Start of code resource */
- pascal void main(TheHandle)
- Handle TheHandle;
- {
- SignedByte HState;
- SndChannelPtr sndChan;
- OSErr sndErr;
-
- RememberA0();
- SetUpA4();
- HState = HGetState(TheHandle);
-
- LoadResource(TheHandle);
- HLock(TheHandle);
-
- sndChan = NIL;
- if ( ResError() == 0 && TheHandle != NIL) {
- sndErr = SndPlay(sndChan,TheHandle,TRUE);
- }
- else
- OKAlert("\pCould not load the resource.");
-
- HUnlock(TheHandle);
- HSetState(TheHandle, HState);
- RestoreA4()
- }
- /* End of code resource */